package nsq

import (
	gconfig "funlog-gserver/config"
	buriedLogHandler "funlog-gserver/handler/nq/buried"
	errLogHandler "funlog-gserver/handler/nq/error"
	logHandler "funlog-gserver/handler/nq/log"
	nsqModel "funlog-gserver/model/nsq"
	"funlog-gserver/stored/nsq"
)

//初始化nq消费者
func InitNQConsumers() {
	//通道id
	uid := gconfig.Cnf["NSQ_PHYSICAL_ID"]
	//初始化消费者
	//上报日志
	logHandler := logHandler.LogNqHandler{}
	nsq.NewConsumers(nsqModel.APPREPORT, uid, &logHandler)
	//错误日志
	errLogHandler := errLogHandler.LogNqHandler{}
	nsq.NewConsumers(nsqModel.APPERROR, uid, &errLogHandler)
	//埋点日志
	buriedLogHandler := buriedLogHandler.LogNqHandler{}
	nsq.NewConsumers(nsqModel.APPBURIEDPOINT, uid, &buriedLogHandler)
}
